from flask import current_app
from . import index_blu
from flask import render_template

# 2. 给当前蓝图创建和定义视图函数
@index_blu.route('/')
def index():
    title = "新经资讯网-首页"
    return render_template("news/index.html",title=title)


@index_blu.route('/favicon.ico')
def favicon():
    # send_static_file 帮我们自动到static目录下读取对应的文件的内容
    return current_app.send_static_file('news/favicon.ico')